package com.example.yls.wuziqidemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {
    private Button btnRestart;
    private Button btnReturn;
    private WuziqiPanel wuziqiPanel;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initViews();
        initEvents();
    }


    private void initViews() {
        btnRestart = findViewById(R.id.btn_restart);
        btnReturn = findViewById(R.id.btn_return);
        wuziqiPanel = findViewById(R.id.qipan);
    }

    private void initEvents() {
        btnRestart.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                wuziqiPanel.reStart();
            }
        });

        btnReturn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                 wuziqiPanel.Return();
            }
        });
    }
}
